package work.huangxin.share.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import work.huangxin.share.domain.manhe.Manhe;
import work.huangxin.share.mapper.ManheMapper;
import work.huangxin.share.service.ManheService;

import java.util.List;

/**
 * @author: 张锦标
 * @date: 2023/5/12 12:26
 * ManheServiceImpl类
 */
@Service
public class ManheServiceImpl implements ManheService {
    @Autowired
    private ManheMapper mapper;
    @Override
    public int add(Manhe manhe) {
        int add = mapper.insert(manhe);
        return add;
    }

    @Override
    public int delete(Long id) {
        int delete = mapper.deleteById(id);
        return delete;
    }

    @Override
    public Manhe get(String sex) {
        Manhe manhe = mapper.get(sex);
        return manhe;
    }

    @Override
    public List<Manhe> getList() {
        return mapper.selectAll1();
    }

    @Override
    public List<Manhe> getManList(String sex) {
        return mapper.getManList(sex);
    }

    @Override
    public int deleteCacheById(Long id) {
        return mapper.deleteCacheById(id);
    }

    @Override
    public int getAllCount() {
        return mapper.getAllCount();
    }
}
